package com.senlingspace.web.controller.system;

import com.senlingspace.common.core.controller.BaseController;
import com.senlingspace.common.core.page.TableDataInfo;
import com.senlingspace.system.domain.SysCity;
import com.senlingspace.system.service.ISysCityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 城市信息Controller
 * 
 * @author SenlingSpace
 * @date 2024-07-01
 */
@RestController
@RequestMapping("/system/city")
public class SysCityController extends BaseController
{
    @Autowired
    private ISysCityService sysCityService;

    /**
     *  根据省份code 获取城市列表
     * @param provinceCode =省份code
     * @return
     */
//    @PreAuthorize("@ss.hasPermi('system:city:list')")
    @GetMapping("/list")
    public TableDataInfo list(String provinceCode)
    {
        List<SysCity> list = sysCityService.selectSysCityList(provinceCode);
        return getDataTable(list);
    }

}
